package com.flurry.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import java.lang.ref.WeakReference;

final class fr extends BroadcastReceiver
{
  private boolean hL;
  private WeakReference<FlurryAgent> hM;
  private Context mContext;

  public fr(Context paramContext, FlurryAgent paramFlurryAgent)
  {
    this.hM = new WeakReference(paramFlurryAgent);
    this.mContext = paramContext;
    this.hL = v(paramContext);
  }

  private static boolean v(Context paramContext)
  {
    NetworkInfo localNetworkInfo = ((ConnectivityManager)paramContext.getSystemService("connectivity")).getActiveNetworkInfo();
    return (localNetworkInfo != null) && (localNetworkInfo.isConnected());
  }

  public final boolean bu()
  {
    return this.hL;
  }

  public final void bv()
  {
    this.hL = v(this.mContext);
    this.mContext.registerReceiver(this, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
  }

  public final void onReceive(Context paramContext, Intent paramIntent)
  {
    boolean bool = v(paramContext);
    FlurryAgent localFlurryAgent = (FlurryAgent)this.hM.get();
    if (localFlurryAgent == null);
    while (this.hL == bool)
      return;
    this.hL = bool;
    localFlurryAgent.onNetworkStateChanged(this.hL);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.fr
 * JD-Core Version:    0.6.2
 */